/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.easoftware.code.beans.jpa;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Eliu
 */
@Entity
@Table(name = "perfil_datos_lineanegocio")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PerfilDatosLineanegocio.findAll", query = "SELECT p FROM PerfilDatosLineanegocio p"),
    @NamedQuery(name = "PerfilDatosLineanegocio.findById", query = "SELECT p FROM PerfilDatosLineanegocio p WHERE p.id = :id")})
public class PerfilDatosLineanegocio implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @JoinColumn(name = "perfil_dagos", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private PerfilDatos perfilDagos;
    @JoinColumn(name = "lineanegocio", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private LineaNegocio lineanegocio;

    public PerfilDatosLineanegocio() {
    }

    public PerfilDatosLineanegocio(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public PerfilDatos getPerfilDagos() {
        return perfilDagos;
    }

    public void setPerfilDagos(PerfilDatos perfilDagos) {
        this.perfilDagos = perfilDagos;
    }

    public LineaNegocio getLineanegocio() {
        return lineanegocio;
    }

    public void setLineanegocio(LineaNegocio lineanegocio) {
        this.lineanegocio = lineanegocio;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += ( id != null ? id.hashCode() : 0 );
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!( object instanceof PerfilDatosLineanegocio )) {
            return false;
        }
        PerfilDatosLineanegocio other = (PerfilDatosLineanegocio) object;
        if (( this.id == null && other.id != null ) || ( this.id != null && !this.id.equals(other.id) )) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "net.easoftware.code.beans.jpa.PerfilDatosLineanegocio[ id=" + id + " ]";
    }
}
